<?php 
$data= base64_decode($_REQUEST["news"]);
$data = rtrim($data, "<br");
$dateref = date("Y_m_j_H_i_s");
$filename = "{$_SERVER["DOCUMENT_ROOT"]}/modules/social_media/news/{$dateref}.html";
file_put_contents($filename, $data);
if (file_exists($filename)) echo "saved";
else echo "not saved";
?>